package com.example.demo.design.chain_responsibility.solution;

/**
 * @Author: liull
 * @Description: 副董事长类 具体的处理者，职责链中的一员
 * @Date: Created in 16:44 2020/12/24
 * @Modified By:
 */
public class VicePresident extends Approver {

    public VicePresident(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getAmount() < 100000) {
            System.out.println(
                    "副董事长" + this.name + "审批采购单：" + request.getNumber() + "，金额：" + request.getAmount() + "元，采购目的：" + request.getPurpose() + "。"); // 处理请求
        } else {
            this.successor.processRequest(request); // 转发请求
        }
    }
}
